-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(core): prevent undefined importer crash in pnpm lockfile parsing #33223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
View your CI Pipeline Execution ↗ for commit 065c8c7
☁️ Nx Cloud last updated this comment at |
When stringifying a pnpm v9 lockfile with workspace packages, Nx crashes with: "Cannot destructure property 'specifiers' of 'projectSnapshot' as it is undefined." This occurs when: - The lockfile has a root importer with `link:` references to workspace packages - But the lockfile is missing the workspace package importer entries - The code tries to access `importers[importerPath]` which returns undefined - This undefined value gets added to the output lockfile - During serialization, it crashes when trying to destructure undefined Workspace packages with missing importers are now silently skipped during lockfile serialization. This prevents the crash and allows Nx to continue operating with out-of-sync lockfiles. The fix adds a null check before adding workspace dependency importers to the output lockfile. Closes NXC-3244
000860c to
065c8c7
Compare
…33223) When stringifying a pnpm v9 lockfile with workspace packages, Nx crashes with: "Cannot destructure property 'specifiers' of 'projectSnapshot' as it is undefined." This occurs when: - The lockfile has a root importer with `link:` references to workspace packages - But the lockfile is missing the workspace package importer entries - The code tries to access `importers[importerPath]` which returns undefined - This undefined value gets added to the output lockfile - During serialization, it crashes when trying to destructure undefined Workspace packages with missing importers are now silently skipped during lockfile serialization. This prevents the crash and allows Nx to continue operating with out-of-sync lockfiles. The fix adds a null check before adding workspace dependency importers to the output lockfile. Closes NXC-3244 (cherry picked from commit 514005a)
…33223) When stringifying a pnpm v9 lockfile with workspace packages, Nx crashes with: "Cannot destructure property 'specifiers' of 'projectSnapshot' as it is undefined." This occurs when: - The lockfile has a root importer with `link:` references to workspace packages - But the lockfile is missing the workspace package importer entries - The code tries to access `importers[importerPath]` which returns undefined - This undefined value gets added to the output lockfile - During serialization, it crashes when trying to destructure undefined Workspace packages with missing importers are now silently skipped during lockfile serialization. This prevents the crash and allows Nx to continue operating with out-of-sync lockfiles. The fix adds a null check before adding workspace dependency importers to the output lockfile. Closes NXC-3244 (cherry picked from commit 514005a)
…33223) When stringifying a pnpm v9 lockfile with workspace packages, Nx crashes with: "Cannot destructure property 'specifiers' of 'projectSnapshot' as it is undefined." This occurs when: - The lockfile has a root importer with `link:` references to workspace packages - But the lockfile is missing the workspace package importer entries - The code tries to access `importers[importerPath]` which returns undefined - This undefined value gets added to the output lockfile - During serialization, it crashes when trying to destructure undefined Workspace packages with missing importers are now silently skipped during lockfile serialization. This prevents the crash and allows Nx to continue operating with out-of-sync lockfiles. The fix adds a null check before adding workspace dependency importers to the output lockfile. Closes NXC-3244 (cherry picked from commit 514005a)
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
When stringifying a pnpm v9 lockfile with workspace packages, Nx crashes with: "Cannot destructure property 'specifiers' of 'projectSnapshot' as it is undefined."
This occurs when:
link:references to workspace packagesimporters[importerPath]which returns undefinedWorkspace packages with missing importers are now silently skipped during lockfile serialization. This prevents the crash and allows Nx to continue operating with out-of-sync lockfiles.
The fix adds a null check before adding workspace dependency importers to the output lockfile.
Closes NXC-3244